<html>
<head>
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="style.css" />
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeRDark.css" rel="stylesheet" type="text/css" />
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js" type="text/javascript"></script>
<script type="text/javascript">
SyntaxHighlighter.all();
</script>
</head>
<body>
<div class="header" style="border-top: 1px solid #C9D7F1;margin: 9px;margin-top: 24px;padding-top: 5px;margin-bottom: 10px;">
    <a href="http://code.google.com/p/yuki/"><img src="http://code.google.com/p/yuki/logo?cct=1297980533" /></a>
    <div style="display: inline-block;padding-left: 11px;">
        <div class="project-name">
            <a style="text-decoration: none;color: #666;font-family: arial, sans-serif;font-size: 39px;" href="http://code.google.com/p/yuki/">yuki</a>
        </div>
        <div class="project-summary">
            <a href="http://code.google.com/p/yuki/" style="text-decoration: none;color: #444;font-family: arial, sans-serif;font-size: 13px;">Yuki PHP Framework</a>
        </div>
    </div>
</div>
<table width="100%"><tr><td width="200" valign="top">
<div class="sidebar"><ul><li class="package">yuki<ul><li class="subpackage">autoload<ul><li class="class"><a href="yAutoloader.html">yAutoloader</a></li><li class="class"><a href="yCoreAutoloader.html">yCoreAutoloader</a></li></ul></li><li class="subpackage">output<ul><li class="class"><a href="yBuffer.html">yBuffer</a></li></ul></li><li class="subpackage">callable<ul><li class="class"><a href="yCallable.html">yCallable</a></li></ul></li><li class="subpackage">debug<ul><li class="class"><a href="yDebugger.html">yDebugger</a></li></ul></li><li class="subpackage">geometry<ul><li class="class"><a href="yDimension.html">yDimension</a></li><li class="class"><a href="yPoint.html">yPoint</a></li><li class="class"><a href="yRectangle.html">yRectangle</a></li></ul></li><li class="subpackage">doc<ul><li class="class"><a href="yDocBlock.html">yDocBlock</a></li><li class="class"><a href="yDocumentor.html">yDocumentor</a></li><li class="class"><a href="yMethodDocumentor.html">yMethodDocumentor</a></li></ul></li><li class="subpackage">exception<ul><li class="class"><a href="yException.html">yException</a></li><li class="class"><a href="yExceptionHandler.html">yExceptionHandler</a></li></ul></li><li class="subpackage">file<ul><li class="class"><a href="yFile.html">yFile</a></li></ul></li><li class="subpackage">log<ul><li class="class"><a href="yLogMessage.html">yLogMessage</a></li><li class="class"><a href="yLogRoute.html">yLogRoute</a></li><li class="class"><a href="yLogger.html">yLogger</a></li><li class="class"><a href="yStderrLogRoute.html">yStderrLogRoute</a></li><li class="class"><a href="yStdoutLogRoute.html">yStdoutLogRoute</a></li><li class="class"><a href="yStreamLogRoute.html">yStreamLogRoute</a></li></ul></li><li class="subpackage">profiler<ul><li class="class"><a href="yProfiler.html">yProfiler</a></li></ul></li><li class="subpackage">uri<ul><li class="class"><a href="yUri.html">yUri</a></li><li class="class"><a href="yUriAuthority.html">yUriAuthority</a></li><li class="class"><a href="yUriFragment.html">yUriFragment</a></li><li class="class"><a href="yUriPath.html">yUriPath</a></li><li class="class"><a href="yUriQuery.html">yUriQuery</a></li><li class="class"><a href="yUriScheme.html">yUriScheme</a></li></ul></li></ul></li></ul></div>            
</td><td valign="top">
            
<h1>yMethodDocumentor</h1>
<div><b>@package</b> yuki</div>
<div><b>@subpackage</b> doc</div>

<!-- Hierarhy -->

<h2>Introduction</h2>
yMethodDocumentor - wrapper around ReflectionMethod<br />
Provides helper methods for html generation<br />



<h2>Method Summary</h2>
<div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.__construct">__construct</a>(<span class="param">$method</span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method">string <a href="#method.getSynopsisHtml">getSynopsisHtml</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.getHref">getHref</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.getLink">getLink</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.getSectionHtml">getSectionHtml</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.getReturns">getReturns</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.getSummaryHtml">getSummaryHtml</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.getArgString">getArgString</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div>
<h2>Method Details</h2>
<div style="padding: 4px;border: solid 1px #666;"><a name="method.__construct"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.__construct">__construct</a>(<span class="param">$method</span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function __construct(ReflectionMethod $method){
        $this-&gt;_method = $method;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getSynopsisHtml"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method">string <a href="#method.getSynopsisHtml">getSynopsisHtml</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div><div><b>returns</b> string </div></div></div><h3>Source Code</h3><pre class="brush: php">    public function getSynopsisHtml(){
        $docBlock = yDocBlock::fromString($this-&gt;_method-&gt;getDocComment());
        $h = '';
        $h .= '&lt;div class=&quot;method&quot;&gt;';
        if ($docBlock-&gt;hasAnnotation('return')){
            $h .= ''.reset(explode(' ', $docBlock-&gt;getAnnotation('return'))).' ';
        }
        /* if ($this-&gt;_method-&gt;isPublic()){
          $h .= 'public ';
          } */
        if ($this-&gt;_method-&gt;isPrivate()){
            $h .= 'private ';
        }
        if ($this-&gt;_method-&gt;isProtected()){
            $h .= 'protected ';
        }
        if ($this-&gt;_method-&gt;isStatic()){
            $h .= 'static ';
        }
        $h .= '&lt;a href=&quot;#method.'.$this-&gt;_method-&gt;getName().'&quot;&gt;'.$this-&gt;_method-&gt;getName().'&lt;/a&gt;';
        $h .= '(';
        $h .= $this-&gt;getArgString();
        $h .= ');';
        $h .= '&lt;/div&gt;';
        return $h;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getHref"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.getHref">getHref</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function getHref(){
        return $this-&gt;_method-&gt;getDeclaringClass()-&gt;getName().'.html#method.'.$this-&gt;_method-&gt;getName();
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getLink"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.getLink">getLink</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function getLink(){
        return '&lt;a href=&quot;#method.'.$this-&gt;_method-&gt;getName().'&quot;&gt;'.$this-&gt;_method-&gt;getName().'&lt;/a&gt;';
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getSectionHtml"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.getSectionHtml">getSectionHtml</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function getSectionHtml(){
        $docBlock = yDocBlock::fromString($this-&gt;_method-&gt;getDocComment());
        $sdesc = $docBlock-&gt;getShortDescription();
        $h = '';
        $h .= '&lt;div style=&quot;padding: 4px;border: solid 1px #666;&quot;&gt;';

        $h .= '&lt;a name=&quot;method.'.$this-&gt;_method-&gt;getName().'&quot;&gt;&lt;/a&gt;';
        $h .= '&lt;div style=&quot;font-size: 11px;&quot;&gt;';
        $h .= '&lt;div class=&quot;classsynopsis&quot;&gt;';
        $h .= $this-&gt;getSynopsisHtml();
        $h .= '&lt;/div&gt;';

        /* $h .= '&lt;h3&gt;'.$this-&gt;_method-&gt;getDeclaringClass()-&gt;getName().'::'.$this-&gt;_method-&gt;getName();
          if (strlen($sdesc)){
          $h .= '&lt;span style=&quot;font-weight: normal; font-size: 14px;&quot;&gt; — '.$sdesc.'&lt;/span&gt;';
          }
          $h .= '&lt;/h3&gt;'; */
        //$h .= '&lt;h4&gt;Description&lt;/h4&gt;';
        //$h .= '&lt;div class=&quot;classsynopsis&quot;&gt;';
        $h .= '&lt;div style=&quot;padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;&quot;&gt;';
        if ($docBlock-&gt;hasAnnotation('param')){
            $params = $docBlock-&gt;getAnnotations('param');
            foreach ($params as $param){
                $a = explode(' ', $param);
                $type = array_shift($a);
                $name = array_shift($a);
                $desc = implode(' ', $a);
                $h .= '&lt;div&gt;&lt;b style=&quot;color: #683B00;&quot;&gt;'.$name.'&lt;/b&gt; ('.$type.') '.$desc.'&lt;/div&gt;';
            }
        }
        $desc = explode(&quot;\n&quot;, $docBlock-&gt;getDescription());
        if (count($desc)){
            $h .= '&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;';
            $first = array_shift($desc);
            $h .= '&lt;div&gt;&lt;h3&gt;'.$first.'&lt;/h3&gt;&lt;/div&gt;';
            $h .= implode(&quot;&lt;br /&gt;&quot;, $desc);
            $h .= '&lt;/div&gt;';
        }
        if ($docBlock-&gt;hasAnnotation('return')){
            $h .= '&lt;div&gt;&lt;b&gt;returns&lt;/b&gt; ';
            $h .= reset(explode(' ', $docBlock-&gt;getAnnotation('return'))).' ';
            $h .= '&lt;/div&gt;';
        }
        $h .= '&lt;/div&gt;';
        $h .= '&lt;/div&gt;';
        $h .= '&lt;h3&gt;Source Code&lt;/h3&gt;';
        $startLine = $this-&gt;_method-&gt;getStartLine();
        $endLine = $this-&gt;_method-&gt;getEndLine();
        $h .= '&lt;pre class=&quot;brush: php&quot;&gt;';
        $h .= htmlspecialchars(yDebugger::getLinesSource($this-&gt;_method-&gt;getFileName(), $startLine, $endLine));
        $h .= '&lt;/pre&gt;';
        $h .= '&lt;/div&gt;';
        return $h;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getReturns"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.getReturns">getReturns</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function getReturns(){
        if ($docBlock-&gt;hasAnnotation('return')){
            return reset(explode(' ', $docBlock-&gt;getAnnotation('return'))).' ';
        }
        return '';
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getSummaryHtml"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.getSummaryHtml">getSummaryHtml</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function getSummaryHtml(){
        $docBlock = yDocBlock::fromString($this-&gt;_method-&gt;getDocComment());
        $sdesc = $docBlock-&gt;getShortDescription();
        $h = '';
        //$h .= '&lt;a name=&quot;method.'.$this-&gt;_method-&gt;getName().'&quot;&gt;&lt;/a&gt;';
        $h .= '&lt;div class=&quot;summary&quot; style=&quot;padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;&quot;&gt;';
        //$h .= '&lt;h3&gt;';
        $h .= $this-&gt;getSynopsisHtml();
        //$h .= '&lt;/h3&gt;';
        $h .= '&lt;div style=&quot;font-size: 11px; margin-top: 1em;&quot;&gt;'.$sdesc.'&lt;/div&gt;';
        $h .= '&lt;/div&gt;';
        return $h;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getArgString"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.getArgString">getArgString</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function getArgString(){
        $args = array();
        $optArgs = array();
        foreach ($this-&gt;_method-&gt;getParameters() as $parameter){
            //$parameter = new ReflectionParameter();
            $arg = '$'.$parameter-&gt;getName().'';
            if ($parameter-&gt;isDefaultValueAvailable()){
                $val = $parameter-&gt;getDefaultValue();
                $arg .= ' = ';
                if (is_string($val)){
                    $arg .= '&quot;'.$val.'&quot;';
                }else{
                    $arg .= $val;
                }
            }
            $parameter-&gt;isPassedByReference();
            /* if ($parameter-&gt;isOptional()){
              $optArgs[] = $arg;
              }else{ */
            $args[] = $arg;
            //}
        }
        $argString = implode(', ', $args);
        if (count($optArgs)){
            $optString = implode(' [, ', $optArgs).str_repeat(']', count($optArgs) - 1);
        }else{
            $optString = '';
        }
        if (strlen($optString)){
            if (strlen($argString)){
                $argString .= ' [, '.$optString.']';
            }else{
                $argString = '['.$optString.']';
            }
        }
        return '&lt;span class=&quot;param&quot;&gt;'.(strlen($argString)?$argString:'').'&lt;/span&gt;';
    }
</pre></div>


<h2>Class synopsis</h2>
<div class="classsynopsis">
<b class="classname">yMethodDocumentor</b> {
<div class="contents">
<h3>/* Properties */</h3>
<div class="property">protected <a href="#property._method">$_method</a>;</div>
<h3>/* Methods */</h3>
<div class="method"><a href="#method.__construct">__construct</a>(<span class="param">$method</span>);</div><div class="method">string <a href="#method.getSynopsisHtml">getSynopsisHtml</a>(<span class="param"></span>);</div><div class="method"><a href="#method.getHref">getHref</a>(<span class="param"></span>);</div><div class="method"><a href="#method.getLink">getLink</a>(<span class="param"></span>);</div><div class="method"><a href="#method.getSectionHtml">getSectionHtml</a>(<span class="param"></span>);</div><div class="method"><a href="#method.getReturns">getReturns</a>(<span class="param"></span>);</div><div class="method"><a href="#method.getSummaryHtml">getSummaryHtml</a>(<span class="param"></span>);</div><div class="method"><a href="#method.getArgString">getArgString</a>(<span class="param"></span>);</div>
</div>
}
</div>


</td></tr></table>
</body>
</html>